/*
 * Created by JFormDesigner on Thu Apr 13 09:29:25 CST 2023
 */

package com.canteen.gui.menusearchform;

import java.awt.*;
import javax.swing.*;
import javax.swing.table.*;

/**
 * @author jf302
 */
public class MenuSearchForm extends JFrame {
    public MenuSearchForm() {
        initComponents();
    }

    private void initComponents() {
        // JFormDesigner - Component initialization - DO NOT MODIFY  //GEN-BEGIN:initComponents  @formatter:off
        menuIdLabel = new JLabel();
        menuIdInput = new JTextField();
        menuNameLabel = new JLabel();
        menuNameInput = new JTextField();
        menuDateLabel = new JLabel();
        menuDateInput = new JSpinner();
        dishesSearchButton = new JButton();
        menuCancelButton = new JButton();
        menuListLabel = new JLabel();
        menuDetailLabel = new JLabel();
        scrollPane1 = new JScrollPane();
        menuTable = new JTable();
        scrollPane2 = new JScrollPane();
        menuDetail = new JList();

        //======== this ========
        setDefaultCloseOperation(WindowConstants.DISPOSE_ON_CLOSE);
        setResizable(false);
        setTitle("\u83dc\u5355\u67e5\u627e");
        var contentPane = getContentPane();
        contentPane.setLayout(null);

        //---- menuIdLabel ----
        menuIdLabel.setText("\u83dc\u5355\u53f7\uff1a");
        contentPane.add(menuIdLabel);
        menuIdLabel.setBounds(new Rectangle(new Point(30, 20), menuIdLabel.getPreferredSize()));
        contentPane.add(menuIdInput);
        menuIdInput.setBounds(85, 20, 115, menuIdInput.getPreferredSize().height);

        //---- menuNameLabel ----
        menuNameLabel.setText("\u83dc\u5355\u540d\uff1a");
        contentPane.add(menuNameLabel);
        menuNameLabel.setBounds(225, 20, 48, 15);
        contentPane.add(menuNameInput);
        menuNameInput.setBounds(280, 20, 115, 21);

        //---- menuDateLabel ----
        menuDateLabel.setText("\u65e5 \u671f\uff1a");
        contentPane.add(menuDateLabel);
        menuDateLabel.setBounds(420, 20, 48, 15);

        //---- menuDateInput ----
        menuDateInput.setModel(new SpinnerDateModel());
        contentPane.add(menuDateInput);
        menuDateInput.setBounds(470, 15, 135, menuDateInput.getPreferredSize().height);

        //---- dishesSearchButton ----
        dishesSearchButton.setText("\u67e5\u627e");
        contentPane.add(dishesSearchButton);
        dishesSearchButton.setBounds(360, 60, 80, dishesSearchButton.getPreferredSize().height);

        //---- menuCancelButton ----
        menuCancelButton.setText("\u53d6\u6d88");
        contentPane.add(menuCancelButton);
        menuCancelButton.setBounds(460, 60, 80, 23);

        //---- menuListLabel ----
        menuListLabel.setText("\u83dc\u5355\u540d\uff1a");
        contentPane.add(menuListLabel);
        menuListLabel.setBounds(30, 120, 48, 15);

        //---- menuDetailLabel ----
        menuDetailLabel.setText("\u83dc\u5355\u5185\u5bb9\uff1a");
        contentPane.add(menuDetailLabel);
        menuDetailLabel.setBounds(350, 120, 65, 15);

        //======== scrollPane1 ========
        {

            //---- menuTable ----
            menuTable.setModel(new DefaultTableModel(
                new Object[][] {
                    {null, null, null},
                    {null, null, null},
                },
                new String[] {
                    "\u83dc\u5355\u53f7", "\u83dc\u5355\u540d", "\u521b\u5efa\u65f6\u95f4"
                }
            ));
            scrollPane1.setViewportView(menuTable);
        }
        contentPane.add(scrollPane1);
        scrollPane1.setBounds(30, 165, 290, 145);

        //======== scrollPane2 ========
        {
            scrollPane2.setViewportView(menuDetail);
        }
        contentPane.add(scrollPane2);
        scrollPane2.setBounds(400, 165, 200, 145);

        {
            // compute preferred size
            Dimension preferredSize = new Dimension();
            for(int i = 0; i < contentPane.getComponentCount(); i++) {
                Rectangle bounds = contentPane.getComponent(i).getBounds();
                preferredSize.width = Math.max(bounds.x + bounds.width, preferredSize.width);
                preferredSize.height = Math.max(bounds.y + bounds.height, preferredSize.height);
            }
            Insets insets = contentPane.getInsets();
            preferredSize.width += insets.right;
            preferredSize.height += insets.bottom;
            contentPane.setMinimumSize(preferredSize);
            contentPane.setPreferredSize(preferredSize);
        }
        setSize(645, 395);
        setLocationRelativeTo(getOwner());
        // JFormDesigner - End of component initialization  //GEN-END:initComponents  @formatter:on
    }

    // JFormDesigner - Variables declaration - DO NOT MODIFY  //GEN-BEGIN:variables  @formatter:off
    private JLabel menuIdLabel;
    private JTextField menuIdInput;
    private JLabel menuNameLabel;
    private JTextField menuNameInput;
    private JLabel menuDateLabel;
    private JSpinner menuDateInput;
    private JButton dishesSearchButton;
    private JButton menuCancelButton;
    private JLabel menuListLabel;
    private JLabel menuDetailLabel;
    private JScrollPane scrollPane1;
    private JTable menuTable;
    private JScrollPane scrollPane2;
    private JList menuDetail;
    // JFormDesigner - End of variables declaration  //GEN-END:variables  @formatter:on
}
